#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <asm/neon.h>

static float32_t neon_add(float32_t a, float32_t b) {
        float32x2_t va = vld1_f32(&a);
            float32x2_t vb = vld1_f32(&b);
                float32x2_t vresult = vadd_f32(va, vb);
                    return vget_lane_f32(vresult, 0);
}

static float32_t neon_sub(float32_t a, float32_t b) {
        float32x2_t va = vld1_f32(&a);
            float32x2_t vb = vld1_f32(&b);
                float32x2_t vresult = vsub_f32(va, vb);
                    return vget_lane_f32(vresult, 0);
}

static float32_t neon_mul(float32_t a, float32_t b) {
        float32x2_t va = vld1_f32(&a);
            float32x2_t vb = vld1_f32(&b);
                float32x2_t vresult = vmul_f32(va, vb);
                    return vget_lane_f32(vresult, 0);
}

static float32_t neon_div(float32_t a, float32_t b) {
        float32x2_t va = vld1_f32(&a);
            float32x2_t vb = vld1_f32(&b);
                float32x2_t vresult = vdiv_f32(va, vb);
                    return vget_lane_f32(vresult, 0);
}

static int __init my_neon_driver_init(void) {
        float32_t a = 10.0;
            float32_t b = 2.0;

                float32_t add_result = neon_add(a, b);
                    float32_t sub_result = neon_sub(a, b);
                        float32_t mul_result = neon_mul(a, b);
                            float32_t div_result = neon_div(a, b);

                                printk(KERN_INFO "Addition result: %f\n", add_result);
                                    printk(KERN_INFO "Subtraction result: %f\n", sub_result);
                                        printk(KERN_INFO "Multiplication result: %f\n", mul_result);
                                            printk(KERN_INFO "Division result: %f\n", div_result);

                                                return 0;
}

static void __exit my_neon_driver_exit(void) {
        // 清理资源
}

module_init(my_neon_driver_init);
module_exit(my_neon_driver_exit);
MODULE_LICENSE("GPL");

}
}
}
}
}
}